<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAlbumsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('albums', function (Blueprint $table) {
            $table->increments('album_id')->comment('主键');
            $table->integer('user_id')->comment('用户ID');
            $table->string('user_name', 20)->comment('用户昵称');
            $table->string('name', 20)->comment('相册名称');
            $table->integer('public')->comment('是否公开0->不公开 1->公开')->default(1);
            $table->integer('count')->comment('图片数')->default(0);
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('albums');
    }
}
